The Swinging Door
|
This page will show you how to design a swinging door and the many uses it can have and how to achieve them. Basically it's a rotating sector which you determine the direction clockwise or anti- clockwise, it's pivot point of rotation, speed and a number of other items. Some say it needs to be connected to another sector, but this is not true as it can function on it's own without any support at all. Ok lets make a single swinging door. Make a room 6 x 6 in Grid 1 and just put a small "door like sector" in it somewhere as shown. I have used the standard size door which is 4 grid squares long in Grid 3, and 32 "Page Up's" from the floor. It's amazing the various sizes you get, but this size you'll find the door Tile 26 fits perfectly. On the other side of the door you will have to press the "F" key to flip the door the right way round.
In my demonstation I used Tile 18 for the ceiling, 54 for the floor, 3 for the walls and 26 for the door as shown below.
Ok - all we need to do now is "tell" the sector what we want it to do. So lets first put an ST1 sprite somewhere in the middle of this door sector. This will be the Sect_Rotator which tells the sector how to behave. The Sect_Rotator "Tag" information you can get from the "Spritags.txt" file which comes on your SW CD. I will only cover the basic tags needed here. At this stage I am not going to bother with sound. Sect_Rotator Tag1 = 143 Tag2 = 101 (match - I always use 101 up for doors) Tag3 = 0 (0 = manual (ie spacebar) / 1 = switch) Tag5 = -512 Angle to move This is normally 512 for clockwise / -512 for anticlockwise. Tag6 = 0 This is a handy tag as you can make other doors open or close when this one opens provided you have their match tag here. Also check Bool5. Tag7 = 35 (about normal) The speed the door swings depending on the sound you select. Tag9 = 0 delay time in 1/8th of a second increments before the door closes. Bool6 = 1 (Can operate it again while it's moving.) Next we need to tell it where we want the pivot point to be. In this case the top left hand of the door sector, so put an ST1 sprite somewhere on the extreme left side of the sector and give it the following tags. Sect_Rotator_Pivot Tag1 = 144 Tag2 = 101 (match - same as the Sect_Rotator) Ok now using the "A" key zoom in on the top left side of the door sector and press "L" to switch Grid Locking off, and drag the ST1 sprite as close to the corner as possible as shown below.
Ok - press "L" again to switch Grid Locking back on again. Load your map into SW and check it out. For dual swinging doors just make another one opposite this one, give it the identical ST1 sprites except the Tag5 of the (143) Sect_Rotator ST1 sprite must be the opposite ie.. 512 and the (144) Sect_Rotator_Pivot ST1 sprite goes in the opposite corner. Now we can have a lot of fun and games with this door;-) If you now set Tag6 = 101 of the (143) Sect_Rotator ST1 sprite, 101 being the "Match Tag" of this door, and Bool5 = 1, then every time you open it, it will close immediatly. By adjusting the speed of the door ie.. Tag7 = 10, you can really mess the player around a bit, giving him only a short break to get in or out. Now if you take the (144) Sect_Rotator_Pivot ST1 sprite and put it in the middle of the door, you can have more fun. Try setting the angle Tag5 to 1024, 2048 or 4096 and also by adjusting the speed Tag7 between 1 and whatever you can get some great effects here. If you want this effect to be triggered before you get to the door, just put a "Trigger" or "Switch" somewhere in the map. There are some neat tricks you can do with "swinging" sectors, like making a door sector "blocking" by pointing to it's sides and pressing the "B" key and just leaving it at floor level, in otherwords the door now becomes invisible. Just think of the uses for this, blocking certain sectors and unblocking them later, pushing the player off a cliff if he stands to near the edge etc.. the list goes on forever. Ok - that's it on swing type doors..... have fun! |